$(function () {
    $('.am-header-title').text('意见反馈');


    function showalert(txt) {
        $("#modal-alert").find(".am-modal-bd").text(txt)
            .end()
            .modal("open");
    }

    $("#submit").click(function () {
        var url = "/h5/submitAdvice"
        var user = JSON.parse(localStorage.getItem("user"));

        var advice = $("#advice").val();
        if (advice == null || advice == "") {
            showalert("请输入您的意见");
            return false;
        }

        $.post(url, {
            advice: advice,
            account: user.account
        }, function (result) {
            if (result.code == '000000') {
                showalert("提交成功")
                window.location.href = '../../app/settings/system.jsp'
            } else {
                showalert("提交失败")
            }
        })


    })
});

